package com.kjc.demo.basic.config;

import javax.annotation.Resource;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.kjc.demo.basic.interceptor.ApiInterceptor;

/**
 * 
 */
@Configuration
//@Profile({"prod"})
//@Profile({"prod", "test"})
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private ApiInterceptor apiInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 自定义拦截器，添加拦截路径和排除拦截路径
    	registry.addInterceptor(apiInterceptor).addPathPatterns("/**").excludePathPatterns("/etc/sdcomm/blacklist","/etc/boc/blacklist");
    }
}

